// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.geocities.com/kpdus/jad.html
// Decompiler options: packimports(3) 

package com.yoyo.series.entities;

import com.google.myjson.stream.JsonReader;
import com.google.myjson.stream.JsonWriter;
import com.stay.lib.utilities.TextUtil;
import java.io.IOException;

// Referenced classes of package com.stayit.series.entities:
//            Persistent

public class CategoryEntity extends Persistent
{

    public CategoryEntity()
    {
    }

    public CategoryEntity(int i)
    {
        groupId = i;
    }

    public CategoryEntity getConstrainObject()
    {
        CategoryEntity categoryentity = new CategoryEntity();
        categoryentity.categroyId = categroyId;
        categoryentity.groupId = groupId;
        return categoryentity;
    }

    public volatile Persistent getConstrainObject()
    {
        return getConstrainObject();
    }

    public void readFromJson(JsonReader jsonreader)
        throws IOException
    {
        jsonreader.beginObject();
        while(jsonreader.hasNext()) 
        {
            String s = jsonreader.nextName();
            if(s.equalsIgnoreCase("groupId"))
                groupId = jsonreader.nextInt();
            else
            if(s.equalsIgnoreCase("categroyId"))
                categroyId = jsonreader.nextLong();
            else
            if(s.equalsIgnoreCase("description"))
                description = jsonreader.nextString();
            else
            if(s.equalsIgnoreCase("iconUrl"))
                iconUrl = jsonreader.nextString();
            else
            if(s.equalsIgnoreCase("timestamp"))
                timestamp = jsonreader.nextLong();
            else
            if(s.equalsIgnoreCase("count"))
                count = jsonreader.nextInt();
            else
                jsonreader.skipValue();
        }
        jsonreader.endObject();
    }

    public String toString()
    {
        return (new StringBuilder()).append("CategoryEntity [groupId=").append(groupId).append(", categroyId=").append(categroyId).append(", description=").append(description).append(", iconUrl=").append(iconUrl).append(", timestamp=").append(timestamp).append(", count=").append(count).append(", isFav=").append(isFav).append("]").toString();
    }

    public void writeToJson(JsonWriter jsonwriter)
        throws IOException
    {
        jsonwriter.beginObject();
        jsonwriter.name("groupId").value(groupId);
        jsonwriter.name("categroyId").value(categroyId);
        if(TextUtil.isValidate(description))
            jsonwriter.name("description").value(description);
        if(TextUtil.isValidate(iconUrl))
            jsonwriter.name("iconUrl").value(iconUrl);
        if(timestamp == 0L)
            timestamp = System.currentTimeMillis();
        jsonwriter.name("timestamp").value(timestamp);
        jsonwriter.endObject();
    }

    public static final String CATEGORYID_STRING = "categroyId";
    private static final String COUNT_STRING = "count";
    public static final String DESCRIPTION_STRING = "description";
    public static final String GROUPID_STRING = "groupId";
    public static final String ICONURL_STRING = "iconUrl";
    public static final String TIMESTAMP_STRING = "timestamp";
    private static final long serialVersionUID = 1L;
    public long categroyId;
    public int count;
    public String description;
    public int groupId;
    public String iconUrl;
    public int isFav;
    public long timestamp;
}
